from lxml import etree
import requests

req = requests.get('https://www.nipic.com/media/ziti/hunsha/index.html',headers={'user-agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36'})
# html = str(req.text)

html = etree.HTML(str(req.text))
print(type(html))
# res = etree.tostring(html)
# print(type(res))
# res =res.decode('utf8')
# print(type(res))
url = html.xpath('//li/a[@class="relative block works-detail hover-none new-works-img-box"]/span/img/@src')
print(url)
url_list = []
for i in url:
   url_list.append('https://fabiaoqing.com'+i)
print(url_list)
# for j in url_list:
#    requests.get(j)
#    with open()